from netfilterqueue import NetfilterQueue

from packet_correctness import *

merger = Merger(2, 1)
packet_correctness_merger = PacketCorrectness(merger, 11110, 'Merger-2-1')

_pkt = b'E\x00\x00X\x00\x01\x00\x00@\x06F\x13\xac\n\x01\x02$\x91b\xef\x1f\x90M\xf1\x00\x00\x00\x00\x00\x00\x00\x00P' \
       b'\x02 \x00\xf6\xc6\x00\x00abcdefffffffffffffff\x00\x00\x00\x01\x00\x00\x00n\x00\x00+f|\xb0\xfcT\xb7\xb0QBM' \
       b'>\xb1\xe9z\xb3\xeb\x03 '


def print_and_accept(pkt):
    # out_pkt = packet_correctness_merger.merge(_pkt)  # generate
    # pkt.set_payload(out_pkt[0])
    pkt.accept()


queue = NetfilterQueue()
queue.bind(1, print_and_accept, max_len=8192)
try:
    queue.run()
except KeyboardInterrupt:
    queue.unbind()
